package Jcat.cduestcbbs.Service;

import java.sql.SQLException;
import java.util.List;

import Jcat.cduestcbbs.Dao.PostsDao;
import Jcat.cduestcbbs.Dao.RecordDao;
import Jcat.cduestcbbs.Dao.UserDao;
import Jcat.cduestcbbs.DaoImpl.PostsDaoImpl;
import Jcat.cduestcbbs.DaoImpl.RecordDaoImpl;
import Jcat.cduestcbbs.DaoImpl.UserDaoImpl;
import Jcat.cduestcbbs.Po.UserPo;

public class UserInformationService {
	UserDao userDaoImpl = new UserDaoImpl();
	PostsDao postsDaoImpl = new PostsDaoImpl();
	RecordDao recordDaoImpl = new RecordDaoImpl();

	public UserPo getUserInformation(int userId) {
		UserPo user = null;
		try {
			user = userDaoImpl.selectUserByuserId(userId);
		} catch (SQLException e) {

			e.printStackTrace();
		}
		return user;
	}

	public List<Object> getPostsListByUserId(int userId) {
		List<Object> postsList = null;
		try {
			postsList = postsDaoImpl.getPostsByUserId(userId);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return postsList;
	}

	public List<Object> getRecordListByUserId(int userId) {
		List<Object> recordList = null;
		try {
			recordList = recordDaoImpl.getRecordListByUserId(userId);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return recordList;
	}

}
